import 'dart:convert';

/*
 * @author 小强
 *
 * @time 12/20/21  2:27 PM
 *
 * @desc 支付实体类
 *
 */

class PayEntity {
  PayEntity({
    this.package,
    this.appid,
    this.outTradeNo,
    this.sign,
    this.appkey,
    this.packageName,
    this.mch_id,
    this.prepayid,
    this.noncestr,
    this.timestamp,
  });

  String package;
  String appid;
  String outTradeNo;
  String sign;
  String appkey;
  String packageName;
  String mch_id;
  String prepayid;
  String noncestr;
  int timestamp;

  factory PayEntity.fromRawJson(String str) => PayEntity.fromJson(json.decode(str));

  String toRawJson() => json.encode(toJson());

  factory PayEntity.fromJson(Map<String, dynamic> json) => PayEntity(
        package: json["package"] == null ? null : json["package"],
        appid: json["appid"] == null ? null : json["appid"],
        outTradeNo: json["outTradeNo"] == null ? null : json["outTradeNo"],
        sign: json["sign"] == null ? null : json["sign"],
        appkey: json["appkey"] == null ? null : json["appkey"],
        packageName: json["packageName"] == null ? null : json["packageName"],
        mch_id: json["mch_id"] == null ? null : json["mch_id"],
        prepayid: json["prepayid"] == null ? null : json["prepayid"],
        noncestr: json["noncestr"] == null ? null : json["noncestr"],
        timestamp: json["timestamp"] == null ? null : json["timestamp"],
      );

  Map<String, dynamic> toJson() => {
        "package": package == null ? null : package,
        "appid": appid == null ? null : appid,
        "outTradeNo": outTradeNo == null ? null : outTradeNo,
        "sign": sign == null ? null : sign,
        "appkey": appkey == null ? null : appkey,
        "packageName": packageName == null ? null : packageName,
        "mch_id": mch_id == null ? null : mch_id,
        "prepayid": prepayid == null ? null : prepayid,
        "noncestr": noncestr == null ? null : noncestr,
        "timestamp": timestamp == null ? null : timestamp,
      };
}
